<template>
    <div class="child-container">
        <!-- {{ modelValue }} -->
        <el-button @click="handlerClick">按钮</el-button>
        <HelloWorld></HelloWorld>
        我是子组件的store：{{ store.userInfo }}
    </div>
</template>
<script setup>
import { watchEffect, toRefs } from 'vue';
import { useUserStore } from '@/store/user.js';
// import HelloWorld from 'hello-word-test9';
import HelloWorld from 'hello-word-test8';

const props = defineProps({
    modelValue: {
        type: Number,
        default: 1
    }
});
const store = useUserStore();
const { userInfo } = toRefs(store);


const emit = defineEmits(['update:modelValue']);

const handlerClick = () => {
    // emit('update:modelValue', props.modelValue + 1);
    // store.setUserInfo('修改了值');
    console.log('store', userInfo.value);  
};

</script>